function plt_data = GET_StdCalibrationSignal(obj, varargin)
%GET_STDCALIBRATIONSIGNAL Summary of this function goes here
%   Detailed explanation goes here
    p=inputParser;
    p.addParameter('demod', 'x');
    p.addParameter('duration', 0.5);
    p.addParameter('isPlot', true, @islogical);
    p.parse(varargin{:});

    obj.controller.enableMagnetometerCalibrationSignal();
    obj.controller.setCalibrationDemodulationPhase(obj.workingPoint.phaseZ);
    
    fprintf('Waiting 5 seconds'); pause(5); fprintf('done.\n');
    plt=obj.controller.ziMaster.plotterModule;
    plt.reset();
    plt.subscribeChannel(obj.controller.DemodSettings.CalibrationDemod.index, {p.Results.demod});
    plt_data= plt.run('window_time', p.Results.duration+0.1, 'total_duration', p.Results.duration);
    plt.unsubscribeChannel();
    
    obj.controller.disableMagnetometerCalibrationSignal();
    obj.controller.setCalibrationDemodulationPhase(obj.workingPoint.phaseY);
    
    %%
    if p.Results.isPlot
        pltData=plt_data.getNodeData(obj.controller.DemodSettings.CalibrationDemod.index, p.Results.demod);            
        figure('Name', 'Calibration Signal');
        plot(pltData.time, pltData.value); grid on;
        xlim(minmax(pltData.time.'));
    end
end

